<div id="sideboxes">
    <? echo $adminMenu->settings(); ?>
    <h2><?php __('Sideboxes administration');?> (<? echo $html -> link(__('new sidebox',true),array('action'=>'add')); ?>)</h2>
    <? echo $form -> create(array('action'=>'delete_sideboxes')); ?>
    <table cellpadding="3" cellspacing="1" width="100%">
        <tr>
            <td width="7%"></td>
            <td></td>
            <td width="10%"></td>
            <td width="10%"></td>
            <td width="10%"></td>
            <td width="10%"></td>
        </tr>
        <tr class="table_head">
            <td colspan="2" class="first-top">
                <? echo $pagination -> create(null,'sideboxes'); ?>
            </td>
            <td colspan="4" class="last-top">
                <? __('Sort by'); ?>: <?php echo $paginator->sort(__('Name',true),'name');?> <? echo $paginator->sort(__('Priority',true),'priority');?> <?php echo $paginator->sort(__('Column',true),'column');?> <?php echo $paginator->sort(__('Visible',true),'display');?>
            </td>
        </tr>
        <tr>
            <th><? __('Action'); ?></th>
            <th><? __('Name'); ?></th>
            <th><? __('Column'); ?></th>
            <th><? __('Priority'); ?></th>
            <th><? __('Visible'); ?></th>
            <th><? __('Delete'); ?> <input type="checkbox" onclick="checkAll(this,'SideboxDeleteSideboxesForm')"/></th>
        </tr>
        <?php
        $i = 0;
        foreach ($sideboxes as $sidebox):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
        <tr<?php echo $class;?>>
            <td>
                    <? echo $html->link($html->image('Edit.png',array('alt'=>__('Edit', true))),array('action'=>'edit', $sidebox['Sidebox']['id']),array('title'=>__('Edit',true)),null,false); ?>
                    <? echo $html->link($html->image('bin.png',array('alt'=>__('Delete', true))), array('action'=>'delete', $sidebox['Sidebox']['id']),array('title'=>__('Delete',true)), __('Delete item', true).' #' . $sidebox['Sidebox']['name'],false); ?>
            </td>
            <td>
                    <? echo $html->link($sidebox['Sidebox']['name'], array('action'=>'edit', $sidebox['Sidebox']['id'])); ?>
            </td>
            <td>
                    <?php echo ($sidebox['Sidebox']['column']==1) ? __('Left column') : (($sidebox['Sidebox']['column']==2) ? __('Middle column') : __('Right column')); ?>
            </td>
            <td>
                    <? echo $sidebox['Sidebox']['priority']; ?>
            </td>
            <td>
                    <?php echo ($sidebox['Sidebox']['display']) ? __('yes') : __('no'); ?>
            </td>
            <td class="actions">
                <input type="checkbox" name="data[SideboxesDelete][]" value="<? echo $sidebox['Sidebox']['id']; ?>"/>
            </td>
        </tr>
        <?php endforeach; ?>
        <tr class="table_head">
            <td colspan="2" class="first-bottom">
                <? echo $pagination -> create(null,'sideboxes'); ?>
            </td>
            <td colspan="4" class="last-bottom">
                <? __('Sort by'); ?>: <?php echo $paginator->sort(__('Name',true),'name');?> <? echo $paginator->sort(__('Priority',true),'priority');?> <?php echo $paginator->sort(__('Column',true),'column');?> <?php echo $paginator->sort(__('Visible',true),'display');?>
            </td>
        </tr>
    </table>
    <div style="float: right; margin: 1em;"><? echo $form -> submit(__('Delete',true)); ?></div>
</form>
</div>